Optimal. Leaf size=592 \[ -\frac {f^2 x}{4 b d^2}+\frac {a^2 (e+f x)^3}{3 b^3 f}+\frac {(e+f x)^3}{6 b f}-\frac {2 a f^2 \cos (c+d x)}{b^2 d^3}+\frac {a (e+f x)^2 \cos (c+d x)}{b^2 d}+\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}+\frac {2 a^3 f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {2 a^3 f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}+\frac {2 i a^3 f^2 \text {Li}_3\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^3}-\frac {2 i a^3 f^2 \text {Li}_3\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^3}-\frac {2 a f (e+f x) \sin (c+d x)}{b^2 d^2}+\frac {f^2 \cos (c+d x) \sin (c+d x)}{4 b d^3}-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.77, antiderivative size = 592, normalized size of antiderivative = 1.00, number of steps
used = 21, number of rules used = 13, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.464, Rules used = {4611, 3392,
32, 2715, 8, 3377, 2718, 3404, 2296, 2221, 2611, 2320, 6724} \begin {gather*} \frac {2 i a^3 f^2 \text {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 d^3 \sqrt {a^2-b^2}}-\frac {2 i a^3 f^2 \text {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^3 d^3 \sqrt {a^2-b^2}}+\frac {2 a^3 f (e+f x) \text {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 d^2 \sqrt {a^2-b^2}}-\frac {2 a^3 f (e+f x) \text {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^3 d^2 \sqrt {a^2-b^2}}+\frac {a^2 (e+f x)^3}{3 b^3 f}+\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 d \sqrt {a^2-b^2}}-\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b^3 d \sqrt {a^2-b^2}}-\frac {2 a f^2 \cos (c+d x)}{b^2 d^3}-\frac {2 a f (e+f x) \sin (c+d x)}{b^2 d^2}+\frac {a (e+f x)^2 \cos (c+d x)}{b^2 d}+\frac {f^2 \sin (c+d x) \cos (c+d x)}{4 b d^3}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2}-\frac {(e+f x)^2 \sin (c+d x) \cos (c+d x)}{2 b d}-\frac {f^2 x}{4 b d^2}+\frac {(e+f x)^3}{6 b f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 32
Rule 2221
Rule 2296
Rule 2320
Rule 2611
Rule 2715
Rule 2718
Rule 3377
Rule 3392
Rule 3404
Rule 4611
Rule 6724
Rubi steps
\begin {align*} \int \frac {(e+f x)^2 \sin ^3(c+d x)}{a+b \sin (c+d x)} \, dx &=\frac {\int (e+f x)^2 \sin ^2(c+d x) \, dx}{b}-\frac {a \int \frac {(e+f x)^2 \sin ^2(c+d x)}{a+b \sin (c+d x)} \, dx}{b}\\ &=-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2}-\frac {a \int (e+f x)^2 \sin (c+d x) \, dx}{b^2}+\frac {a^2 \int \frac {(e+f x)^2 \sin (c+d x)}{a+b \sin (c+d x)} \, dx}{b^2}+\frac {\int (e+f x)^2 \, dx}{2 b}-\frac {f^2 \int \sin ^2(c+d x) \, dx}{2 b d^2}\\ &=\frac {(e+f x)^3}{6 b f}+\frac {a (e+f x)^2 \cos (c+d x)}{b^2 d}+\frac {f^2 \cos (c+d x) \sin (c+d x)}{4 b d^3}-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2}+\frac {a^2 \int (e+f x)^2 \, dx}{b^3}-\frac {a^3 \int \frac {(e+f x)^2}{a+b \sin (c+d x)} \, dx}{b^3}-\frac {(2 a f) \int (e+f x) \cos (c+d x) \, dx}{b^2 d}-\frac {f^2 \int 1 \, dx}{4 b d^2}\\ &=-\frac {f^2 x}{4 b d^2}+\frac {a^2 (e+f x)^3}{3 b^3 f}+\frac {(e+f x)^3}{6 b f}+\frac {a (e+f x)^2 \cos (c+d x)}{b^2 d}-\frac {2 a f (e+f x) \sin (c+d x)}{b^2 d^2}+\frac {f^2 \cos (c+d x) \sin (c+d x)}{4 b d^3}-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2}-\frac {\left (2 a^3\right ) \int \frac {e^{i (c+d x)} (e+f x)^2}{i b+2 a e^{i (c+d x)}-i b e^{2 i (c+d x)}} \, dx}{b^3}+\frac {\left (2 a f^2\right ) \int \sin (c+d x) \, dx}{b^2 d^2}\\ &=-\frac {f^2 x}{4 b d^2}+\frac {a^2 (e+f x)^3}{3 b^3 f}+\frac {(e+f x)^3}{6 b f}-\frac {2 a f^2 \cos (c+d x)}{b^2 d^3}+\frac {a (e+f x)^2 \cos (c+d x)}{b^2 d}-\frac {2 a f (e+f x) \sin (c+d x)}{b^2 d^2}+\frac {f^2 \cos (c+d x) \sin (c+d x)}{4 b d^3}-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2}+\frac {\left (2 i a^3\right ) \int \frac {e^{i (c+d x)} (e+f x)^2}{2 a-2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{b^2 \sqrt {a^2-b^2}}-\frac {\left (2 i a^3\right ) \int \frac {e^{i (c+d x)} (e+f x)^2}{2 a+2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{b^2 \sqrt {a^2-b^2}}\\ &=-\frac {f^2 x}{4 b d^2}+\frac {a^2 (e+f x)^3}{3 b^3 f}+\frac {(e+f x)^3}{6 b f}-\frac {2 a f^2 \cos (c+d x)}{b^2 d^3}+\frac {a (e+f x)^2 \cos (c+d x)}{b^2 d}+\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {2 a f (e+f x) \sin (c+d x)}{b^2 d^2}+\frac {f^2 \cos (c+d x) \sin (c+d x)}{4 b d^3}-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2}-\frac {\left (2 i a^3 f\right ) \int (e+f x) \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{b^3 \sqrt {a^2-b^2} d}+\frac {\left (2 i a^3 f\right ) \int (e+f x) \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{b^3 \sqrt {a^2-b^2} d}\\ &=-\frac {f^2 x}{4 b d^2}+\frac {a^2 (e+f x)^3}{3 b^3 f}+\frac {(e+f x)^3}{6 b f}-\frac {2 a f^2 \cos (c+d x)}{b^2 d^3}+\frac {a (e+f x)^2 \cos (c+d x)}{b^2 d}+\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}+\frac {2 a^3 f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {2 a^3 f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {2 a f (e+f x) \sin (c+d x)}{b^2 d^2}+\frac {f^2 \cos (c+d x) \sin (c+d x)}{4 b d^3}-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2}-\frac {\left (2 a^3 f^2\right ) \int \text {Li}_2\left (\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{b^3 \sqrt {a^2-b^2} d^2}+\frac {\left (2 a^3 f^2\right ) \int \text {Li}_2\left (\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{b^3 \sqrt {a^2-b^2} d^2}\\ &=-\frac {f^2 x}{4 b d^2}+\frac {a^2 (e+f x)^3}{3 b^3 f}+\frac {(e+f x)^3}{6 b f}-\frac {2 a f^2 \cos (c+d x)}{b^2 d^3}+\frac {a (e+f x)^2 \cos (c+d x)}{b^2 d}+\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}+\frac {2 a^3 f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {2 a^3 f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {2 a f (e+f x) \sin (c+d x)}{b^2 d^2}+\frac {f^2 \cos (c+d x) \sin (c+d x)}{4 b d^3}-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2}+\frac {\left (2 i a^3 f^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {i b x}{a-\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{b^3 \sqrt {a^2-b^2} d^3}-\frac {\left (2 i a^3 f^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (\frac {i b x}{a+\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{b^3 \sqrt {a^2-b^2} d^3}\\ &=-\frac {f^2 x}{4 b d^2}+\frac {a^2 (e+f x)^3}{3 b^3 f}+\frac {(e+f x)^3}{6 b f}-\frac {2 a f^2 \cos (c+d x)}{b^2 d^3}+\frac {a (e+f x)^2 \cos (c+d x)}{b^2 d}+\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}-\frac {i a^3 (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d}+\frac {2 a^3 f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}-\frac {2 a^3 f (e+f x) \text {Li}_2\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^2}+\frac {2 i a^3 f^2 \text {Li}_3\left (\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^3}-\frac {2 i a^3 f^2 \text {Li}_3\left (\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b^3 \sqrt {a^2-b^2} d^3}-\frac {2 a f (e+f x) \sin (c+d x)}{b^2 d^2}+\frac {f^2 \cos (c+d x) \sin (c+d x)}{4 b d^3}-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 b d}+\frac {f (e+f x) \sin ^2(c+d x)}{2 b d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.21, size = 909, normalized size = 1.54 \begin {gather*} \frac {24 a^2 d^3 e^2 x+12 b^2 d^3 e^2 x+24 a^2 d^3 e f x^2+12 b^2 d^3 e f x^2+8 a^2 d^3 f^2 x^3+4 b^2 d^3 f^2 x^3+24 a b \left (-2 f^2+d^2 (e+f x)^2\right ) \cos (c+d x)-6 b^2 d f (e+f x) \cos (2 (c+d x))-\frac {24 i a^3 \left (-i \left (d^2 \left (\sqrt {a^2-b^2} f x (2 e+f x) \left (-\log \left (1+\frac {b (\cos (2 c+d x)+i \sin (2 c+d x))}{i a \cos (c)+\sqrt {\left (-a^2+b^2\right ) (\cos (c)+i \sin (c))^2}-a \sin (c)}\right )+\log \left (1-\frac {b (\cos (2 c+d x)+i \sin (2 c+d x))}{-i a \cos (c)+\sqrt {\left (-a^2+b^2\right ) (\cos (c)+i \sin (c))^2}+a \sin (c)}\right )\right ) (\cos (c)+i \sin (c))+2 e^2 \tan ^{-1}\left (\frac {b \cos (c+d x)+i (a+b \sin (c+d x))}{\sqrt {a^2-b^2}}\right ) \sqrt {-\left (\left (a^2-b^2\right ) (\cos (c)+i \sin (c))^2\right )}\right )-2 \sqrt {a^2-b^2} f^2 \text {Li}_3\left (-\frac {b (\cos (2 c+d x)+i \sin (2 c+d x))}{i a \cos (c)+\sqrt {\left (-a^2+b^2\right ) (\cos (c)+i \sin (c))^2}-a \sin (c)}\right ) (\cos (c)+i \sin (c))+2 \sqrt {a^2-b^2} f^2 \text {Li}_3\left (\frac {b (\cos (2 c+d x)+i \sin (2 c+d x))}{-i a \cos (c)+\sqrt {\left (-a^2+b^2\right ) (\cos (c)+i \sin (c))^2}+a \sin (c)}\right ) (\cos (c)+i \sin (c))\right )+2 \sqrt {a^2-b^2} d f (e+f x) \text {Li}_2\left (-\frac {b (\cos (2 c+d x)+i \sin (2 c+d x))}{i a \cos (c)+\sqrt {\left (-a^2+b^2\right ) (\cos (c)+i \sin (c))^2}-a \sin (c)}\right ) (\cos (c)+i \sin (c))-2 \sqrt {a^2-b^2} d f (e+f x) \text {Li}_2\left (\frac {b (\cos (2 c+d x)+i \sin (2 c+d x))}{-i a \cos (c)+\sqrt {\left (-a^2+b^2\right ) (\cos (c)+i \sin (c))^2}+a \sin (c)}\right ) (\cos (c)+i \sin (c))\right )}{\sqrt {a^2-b^2} \sqrt {-\left (\left (a^2-b^2\right ) (\cos (c)+i \sin (c))^2\right )}}-48 a b d e f \sin (c+d x)-48 a b d f^2 x \sin (c+d x)-6 b^2 d^2 e^2 \sin (2 (c+d x))+3 b^2 f^2 \sin (2 (c+d x))-12 b^2 d^2 e f x \sin (2 (c+d x))-6 b^2 d^2 f^2 x^2 \sin (2 (c+d x))}{24 b^3 d^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.32, size = 0, normalized size = 0.00 \[\int \frac {\left (f x +e \right )^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{a +b \sin \left (d x +c \right )}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 2059 vs. \(2 (532) = 1064\).
time = 0.59, size = 2059, normalized size = 3.48 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F(-1)]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \text {Hanged} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________